home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / pdcurs21.zip / PRIVATE.ZIP / _GCURROW.C < prev    next >
Text File  |  1992-11-21  |  1KB  |  53 lines

  1. #define        CURSES_LIBRARY  1
  2. #include <curses.h>
  3.  
  4. #ifndef        NDEBUG
  5. char *rcsid__gcurrow = "$Header: c:/curses/private/RCS/_gcurrow.c%v 2.0 1992/11/15 03:24:23 MH Rel $";
  6. #endif
  7.  
  8.  
  9.  
  10.  
  11. /*man-start*********************************************************************
  12.  
  13.   PDC_get_cur_row()    - get current row position of cursor
  14.  
  15.   PDCurses Description:
  16.        This is a private PDCurses function
  17.  
  18.        This routine returns the current row position of the cursor on
  19.        screen.
  20.  
  21.   PDCurses Return Value:
  22.        This routine returns the current row position of the cursor. No
  23.        error is returned.
  24.  
  25.   PDCurses Errors:
  26.        There are no defined errors for this routine.
  27.  
  28.   Portability:
  29.        PDCurses        int     PDC_get_cur_row( void );
  30.  
  31. **man-end**********************************************************************/
  32.  
  33. int    PDC_get_cur_row(void)
  34. {
  35. #ifdef FLEXOS
  36.        retcode = s_get(T_VIRCON, 1L, (char *) &vir, (long) sizeof(vir));
  37.        return( (retcode < 0L) ? ERR : vir.vc_cursor.pos_col );
  38. #endif
  39. #ifdef DOS
  40.        regs.x.ax = 0x0003;
  41.        regs.h.bh = _cursvar.video_page;
  42.        int86(0x10, ®s, ®s);
  43.        return ((int) regs.h.dh);
  44. #endif
  45. #ifdef OS2
  46.        USHORT curCol, curRow;
  47.        
  48.        /* find the current cursor position */
  49.        VioGetCurPos ((PUSHORT) &curRow, (PUSHORT) &curCol, 0);
  50.        return (curRow);
  51. #endif
  52. }
  53.